#ifndef CMODELCLASS_H
#define CMODELCLASS_H

#include "TextureClass.h"

class CModelClass
{
	struct VertexType
	{
		D3DXVECTOR3 d3dPos;
		//D3DXVECTOR4 d3dColor;
		D3DXVECTOR2 d3dTexture;
		D3DXVECTOR3 d3dNormal;
	};
	
	struct ModelType
	{
		float fX;
		float fY;
		float fZ;
		float fU;
		float fV;
		float fXNorm;
		float fYNorm;
		float fZNorm;
	};

	ID3D11Buffer* m_pVertexBuffer;
	ID3D11Buffer* m_pIndexBuffer;
	CTextureClass* m_pTexture;
	ModelType* m_pModel;
	int m_nVertexCount;
	int m_nIndexCount;

	bool InitializeBuffers(ID3D11Device* pDevice);
	void ShutDownBuffers();
	void RenderBuffers(ID3D11DeviceContext* pDeviceContext);
	bool LoadTexture(ID3D11Device* pDevice, WCHAR* pwscTextureName);
	void ReleaseTexture();
	bool LoadModel(char* cFileName);
	void ReleaseModel();

public:
	CModelClass(void);
	CModelClass(const CModelClass&);
	~CModelClass(void);

	bool Initialize(ID3D11Device* pDevice, char* cModelFileName, WCHAR* pwszTextureFileName);
	void ShutDown();
	void Render(ID3D11DeviceContext* pDeviceContext);

	int GetIndexCount();

	ID3D11ShaderResourceView* GetTexture();
};

#endif